package fr.irit.etracetool.simpleemf;

import fr.irit.etracetool.etrace.LinkType;
import fr.irit.etracetool.etrace.ETrace;
import fr.irit.etracetool.etrace.EtraceFactory;


public class TypesCollection {

	public LinkType firstCategory;
	
	public LinkType secondCategory;
	
	public LinkType thirdCategory;
	
	public LinkType fourthCategory;
	
	public LinkType fifthCategory;
	
	public TypesCollection(ETrace trace) {
		firstCategory = initializeLinkType("Fonctionnal method", "EClass fusion(EClass c1, EClass c2", "Fonctionnal Method","","",trace);
		secondCategory = initializeLinkType("Factory method", "LinkType l = EtraceFactory.eINSTANCE.createLinkType();", "Factory method","","",trace);
		thirdCategory = initializeLinkType("Setter method", "l.setExample(example);", "Setter Method","","",trace);
		fourthCategory = initializeLinkType("Add Feature", "class.getEOperation.add(operation);","Add Feature","","",trace);
		fifthCategory = initializeLinkType("Remove Feature", "class.getEOperation.remove(operation)", "Remove Feature","","",trace);
	}

	private LinkType initializeLinkType(String description, String example, String name, String purpose, String uses, ETrace trace) {
		LinkType l = EtraceFactory.eINSTANCE.createLinkType();
		l.setDescription(description);
		l.setExample(example);
		l.setName(name);
		l.setPurpose(purpose);
		l.setUses(uses);
		trace.getTypeList().add(l);
		return l;
	}

}
